home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr50
/
pbc22b.zip
/
PBC$BAS.ZIP
/
GETCOLOR.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-01-01
|
1KB
|
25 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1993 Thomas G. Hanlin III |
' | |
' +----------------------------------------------------------------------+
DECLARE SUB UnCalcAttr (Foreground%, Background%, BYVAL VAttr%)
SUB GetColor (Fore%, Back%)
Row% = CSRLIN ' get current cursor position
Col% = POS(0)
Ch$ = CHR$(SCREEN(1, 1)) ' save char and colors at 1, 1
VAttr% = SCREEN(1, 1, 1)
LOCATE 1, 1 ' print char there in current color
PRINT Ch$;
DefAttr% = SCREEN(1, 1, 1) ' get the current default color
UnCalcAttr Fore%, Back%, VAttr% ' restore the old color
COLOR Fore%, Back%
LOCATE 1, 1
PRINT Ch$;
LOCATE Row%, Col%
UnCalcAttr Fore%, Back%, DefAttr% ' return the current default color
COLOR Fore%, Back% ' restore it as the default
END SUB